<script src="<?= base_url(); ?>third_party/ckeditor/ckeditor.js"></script>

<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> EMAIL TEMPLATE MANAGEMENT </header>
		<div class="panel-body">
			<form class="form-horizontal" role="form" name="cat" method="POST"
				action="<?= base_url(); ?>secure/template/email_template/get_tempalate">
				
				<?php if($this->session->flashdata('message'))
				{
					$msg=$this->session->flashdata('message');
					echo '<font color="red">'.$msg.'</font>';
				}
				?>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Template Type</label>
					<div class="col-lg-3">
						<select class="form-control" name="email_tempalte" onchange="this.form.submit()">
							<option selected="selected" value="">- - - Select Template-
								- -</option>
								<?php foreach ($emailtemp as $emailtemp): ?>
                                <option value="<?= $emailtemp->id; ?>"><?= $emailtemp->title; ?></option>
                            <?php endforeach; ?>
						</select>
					</div>
				</div>


			</form>
		</div>
		<!-- End of Body Panel -->
	</section>
	<!-- page end-->
	
	<?php if (isset($row['info']->id)) { ?>
	<section class="panel">
					<header class="panel-heading"> EMAIL TEMPLATE MANAGEMENT :  <?= $row['info']->title; ?> </header>
					<div class="panel-body">
						<form class="form-horizontal" role="form"
						name="keyword" method="POST"
				action="<?= base_url(); ?>secure/template/email_template/update_template">
  <?php
                        if ($this->session->flashdata('message')) {
                            $msg = $this->session->flashdata('message');
                            echo '<font color="red">' . $msg . '</font>';
                        }
                        ?>
										
							<div class="form-group">
							<label for="input" class="col-lg-2 control-label">Template Type</label>
								<div class="col-lg-8">

									<textarea class="form-control ckeditor" id="email_temp" name="temp_detail" rows="6">
									<?= $row['info']->description; ?>
									</textarea>
									<script
									type="text/javascript">
                                //<![CDATA[
                                CKEDITOR.replace( 'email_temp',
                                {
                                    skin : 'v2',
                                    enterMode : CKEDITOR.ENTER_DIV,
                                    toolbar :
                                        [
                                        [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
                                        [ 'UIColor' ]
                                    ]
                                });
                                //]]>
                            </script>
<input name="template_status" type="radio" value="1" <?php if ($row['info']->status == '1')
                        echo 'checked=cheked' ?>/>Inactive <input name="template_status" type="radio" value="51" <?php if ($row['info']->status == '51')
                        echo 'checked=cheked' ?>/> Active
                        <label>&nbsp;</label>
								</div>
								
							</div>

							<div class="form-group">
								<div class="col-lg-offset-2 col-lg-8">
								<input type="hidden" name="temp_id" value="<?= $row['info']->id; ?>"/> 
								 
									<input type="submit" class="pull-right btn btn-info"  name="update_template"
							<?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');" value="Update"
								onclick="nicEditors.findEditor('cmscontent').saveContent();return confirm('Are you sure you want to update?');" />
								</div>
							</div>


						</form>
					</div>
					<!-- End of Body Panel -->
				</section>
				<!-- page end-->
	<?php }?>
</section>


				











